<template>
    <div>
        <el-container>
            <el-header>
                <div>
                    <span>六组二阶段项目重做管理系统(简洁版)</span>
                </div>
                <div>
                    <span v-if="false">{{getType}}</span>
                    <span v-else>默认职位</span>
                    <span>：</span>
                    <span>{{name}}</span>
                    <button @click="out">退出登录</button>
                </div>
            </el-header>
            <el-container>
                <el-aside style="width: 200px;height: 540px">
                   <!-- <LeftNav v-if="getType === '总经理'"></LeftNav>
                    <LeaderNav v-else-if="getType === '项目经理'"></LeaderNav>
                    <StaffNav v-else-if="getType === '普通员工'"></StaffNav>-->
                    <LeftNav></LeftNav>
                </el-aside>
                <el-main style="height:540px ">
                    <router-view></router-view>
                </el-main>
            </el-container>
        </el-container>
    </div>
</template>

<script>
    import LeftNav from '../components/navCom/LeftNav'
    import LeaderNav from '../components/navCom/LeaderNav'
    import StaffNav from '../components/navCom/StaffNav'
    import {mapActions,mapGetters} from 'vuex'
    export default {
        name: "index",
        components:{
            LeftNav,
            StaffNav,
            LeaderNav,
        },
        data(){
            return{
                name:'默认名字'
            }
        },
        computed:{
            ...mapGetters(['getType']),
        },
        methods:{
            ...mapActions(['outLogin']),
            out(){
                this.outLogin()
                this.$router.push('/login')
            }
        },
        created() {
            //this.name = this.$store.state.user.userName
        }
    }
</script>

<style scoped lang="less">
    .el-header, .el-footer {
        background-color: #B3C0D1;
        color: #333;
        text-align: center;
        div{
            margin-top: 5px;
            span,button{
                margin-left: 20px;
            }
            button{
                margin-right: 20px;
            }
        }
    }

    .el-aside {
        background-color: #D3DCE6;
        color: #333;
        text-align: center;
    }

    .el-main {
        background-color: #E9EEF3;
        color: #333;
    }

    body > .el-container {
        margin-bottom: 40px;
    }

    .el-container:nth-child(5) .el-aside,
    .el-container:nth-child(6) .el-aside {

    }
    .el-container:nth-child(7) .el-aside {

    }
</style>